From 29b2961725ae2e8c557c219e20e9c0844d82b809 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 26 Dec 2008 16:49:30 +0000 Subject: [PATCH] (keymap-canonicalize): Properly preserve keymap prompt. --- lisp/ChangeLog | 2 ++ lisp/subr.el | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 35495c41b0e..a046cbf005a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2008-12-26 Andreas Schwab + * subr.el (keymap-canonicalize): Properly preserve keymap prompt. + * tar-mode.el (tar-swap-data): New function. (tar-change-major-mode-hook): Use it instead of buffer-swap-text. (tar-mode-revert): Likewise. diff --git a/lisp/subr.el b/lisp/subr.el index a7027b44fda..7c8f844164f 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -558,7 +558,8 @@ Don't call this function; it is for internal use only." (defun keymap-canonicalize (map) "Return an equivalent keymap, without inheritance." (let ((bindings ()) - (ranges ())) + (ranges ()) + (prompt (keymap-prompt map))) (while (keymapp map) (setq map (map-keymap-internal (lambda (key item) @@ -567,8 +568,7 @@ Don't call this function; it is for internal use only." (push (cons key item) ranges) (push (cons key item) bindings))) map))) - (setq map (funcall (if ranges 'make-keymap 'make-sparse-keymap) - (keymap-prompt map))) + (setq map (funcall (if ranges 'make-keymap 'make-sparse-keymap) prompt)) (dolist (binding ranges) ;; Treat char-ranges specially. (define-key map (vector (car binding)) (cdr binding))) -- 2.30.2